//引入发布订阅模式的文件
import "./utils/publish-subscription";
import "./utils/cookie";
import "./utils/setEditConfig";
import "./utils/ENV";
import plugin from './utils/WXH/plugin.js'
import initConfigParams from "./utils/settings/initInterface";
import "./utils/initFontSize";
import Vue from 'vue'
import App from './App'
import store from "./store";
import dragPlugin from "./helper/drag-plugin";
import "@/lib/css/mall.css";
import 'mint-ui/lib/style.css'
import VueLazyload from 'vue-lazyload';
import initMgrouter from "./utils/settings/initMgrouter";
import {registerComponents} from "./utils/settings/registerComponentsInEditModel";
Vue.use(VueLazyload, {
	loading: 'static/image/demo1.png',
	error: 'static/image/demo2.png',
});

Vue.use(dragPlugin);
Vue.use(plugin);
Vue.config.productionTip = false
function shopIsClosed(state) {
	return !state;
}
async function init() {
	registerComponents();
	// await initInterface;
	let state = await initConfigParams();
	console.log("初始化完参数");
	// console.log("await initConfigParams--->window.manifest", window.manifest);
	// let state = await getConfigParams();
	let router = await initMgrouter(shopIsClosed(state));
	// console.log("请求到的配置参数", JSON.parse(sessionStorage.getItem("configParams")));
	new Vue({
		el: '#app',
		router,
		store,
		template: '<App/>',
		components: { App }
	});
	/*hideLoading();*/
}
init();
// export default instance;